import time

fn com_thread(f chan int, start int, end int) {
	// time.sleep(10000000000)
	f <- 3

	for i in start..end {
		f<-i
	}
}


fn producer(c chan int) {
	mut i:=30
	for {
		c <-i
	}
}

fn consumer(c chan int) {
	mut i := int(0)
	for {
		i = <-c
		println(i)
	}
}

fn main() {
	ch := chan int{}
	mut recv := int(0)
	// go producer(ch)
	// go consumer (ch)


	go com_thread(ch, 10, 25)
	go com_thread(ch, 10, 25)
	go com_thread(ch, 10, 25)
	for {
		recv = <-ch
		println(recv)
	}
}